import { useContext } from 'react'
import { ctxCreator } from '@/library/libs/context/ctx-creator'
import {
  configCtxInitData,
  configCtxSetDebugAction,
  configCtxSetLanguageAction,
  configCtxReducer,
} from './config-ctx'

const [configCtx, ConfigCtxProvider] = ctxCreator(configCtxReducer, configCtxInitData)

const useConfigCtx = () => useContext(configCtx)

export {
  configCtx,
  configCtxSetDebugAction,
  configCtxSetLanguageAction,
  ConfigCtxProvider,
  useConfigCtx,
}
